<template>
  <div class="home">
    <el-container>
      <el-header>
        <Header></Header>
      </el-header>
      <el-main
          v-loading="loading">
        <Main></Main>
      </el-main>
      <el-footer>
        <Footer></Footer>
      </el-footer>
    </el-container>
  </div>
</template>

<script>
// @ is an alias to /src

import Header from "./components/Header";
import Main from "./components/Main";
import Footer from "./components/Footer";

export default {
  name: 'home',
  data(){
    return {
    }
  }
  ,
  components: {
    Header,
    Main,
    Footer
  },
  computed: {
    loading: function () {
      return this.$store.state.homeLoading
    }
  }
  ,
  beforeRouteEnter(to, from, next){
    if (to.meta.title){
      document.title = to.meta.title + " - my blog"
    }
    next()
  }
}
</script>

<style scoped>
  .el-main {
    background-color: #F4F4F4;
    color: #333;
    text-align: center;
  }

  .el-header {
    border-bottom: 1px solid #e6e6e6;
    box-shadow: 0 0 6px rgba(0, 0, 0, .04);
    z-index: 1000;
  }

  .el-footer {
    border-top: 1px solid #e6e6e6;
    line-height: 160px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }
</style>
